package com.motong.gongdan.constant;

import com.motong.gongdan.enums.ObjectType;

import java.util.Collections;
import java.util.HashMap;
import java.util.Map;

public class ColumnTypeIconMap {

    private final Map<String, Map<String, String>> modelTypeMap = new HashMap<>(1);


    public ColumnTypeIconMap() {

        Map<String, String> workOrderTypeIconMap = new HashMap<>(9);
        workOrderTypeIconMap.put("inputNumber", "icon-jijiafangshi");
        workOrderTypeIconMap.put("datePicker", "icon-rili");
        workOrderTypeIconMap.put("picture", "icon-tupian");
        workOrderTypeIconMap.put("selectRadio", "icon-xuanzekuang-danxuanyixuan");
        workOrderTypeIconMap.put("selectChecked", "icon-xwtubiaoku-04");
        workOrderTypeIconMap.put("formula", "icon-icon_fx");
        workOrderTypeIconMap.put("relevanceObject", "icon-shengchanxianmoban-suanfabangding");
        workOrderTypeIconMap.put("relevanceProp", "icon-guanlian-copy");
        workOrderTypeIconMap.put("ipt", "icon-icon");
        modelTypeMap.put(ObjectType.workOrder.getCode(), workOrderTypeIconMap);
    }

    /**
     * 获取图标名称
     *
     * @param module     所属模块
     * @param columnType 字段类型
     */
    public String getIconByName(String module, String columnType) {
        return modelTypeMap.getOrDefault(module, Collections.emptyMap()).getOrDefault(columnType, "");
    }

}
